package com.szosen.util;

/**
 * Created by HASEE on 2017-08-03.
 */

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Handler;
import android.text.TextUtils;

import com.google.gson.Gson;
import com.szosen.database.AccessoryExamination;
import com.szosen.database.ChineseMedicineManage;
import com.szosen.database.DBService;
import com.szosen.database.Examination;
import com.szosen.database.HealthAssessment;
import com.szosen.database.InhospitalSituation;
import com.szosen.database.LifestySituation;
import com.szosen.database.MedicineSituation;
import com.szosen.database.NonimmuneInoculation;
import com.szosen.database.OldPeopleSelfCare;
import com.szosen.database.base_info;
import com.szosen.database.niaoye;
import com.szosen.database.tiwen;
import com.szosen.database.xindian;
import com.szosen.database.xuetang;
import com.szosen.database.xueya;
import com.szosen.jkzj.R;
import com.szosen.jkzj.activity.UserListActivity;
import com.szosen.json.Archive;
import com.szosen.json.GetArchiveDetail;
import com.szosen.json.OldAssessment;
import com.szosen.json.database.ArchiveBean;
import com.szosen.json.database.JSONDBService;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/***
 * 批量打印工具。
 */
public class MultiPrintTool {
    private static final Paint textPaint = new Paint();
    private static final Paint smallTextPaint = new Paint();
    private static final int textColor = Color.BLACK;
    private static int textSize = 27;
    private static int smallTextSize = 18;

    static {
        textPaint.setStrokeWidth(3);
        textPaint.setDither(true);
        textPaint.setStyle(Paint.Style.FILL);
        textPaint.setTextSize(textSize);
        textPaint.setColor(textColor);

        smallTextPaint.setStrokeWidth(3);
        smallTextPaint.setDither(true);
        smallTextPaint.setStyle(Paint.Style.FILL);
        smallTextPaint.setTextSize(smallTextSize);
        smallTextPaint.setColor(textColor);
    }

    /***
     * 批量生产或打印健康档案
     * @param context
     * @param queryDatas 需要查询的key(time)集合。循环查询每个Archive
     * @param handler  通知是否完成。
     * @param needPrint  是否需要调用printershare打印？
     */
    public static void multiCreateJkda(final Context context, final List<String> queryDatas, final Handler handler, final boolean needPrint
    ) {
        new BackGroundThread(new BackGroundThread.BackGroundTask() {
            @Override
            public void process() {
                ArrayList<Uri> imageUris = new ArrayList<>();
                //循环查询健康档案
                for (int i = 0; i < queryDatas.size(); i++) {
                    String queryTime = queryDatas.get(i);
                    if (!TextUtils.isEmpty(queryTime)) {
                        // 从数据库获取单个健康档案数据。
                        ArchiveBean queryBean = new ArchiveBean();
                        queryBean.setTime(queryTime);
                        ArchiveBean bean = null;
                        List<ArchiveBean> lists = (List<ArchiveBean>) JSONDBService
                                .queryByKey(queryBean);
                        if (lists != null && lists.size() > 0) {
                            bean = lists.get(0);
                            Archive archive = null;
                            archive = new Gson().fromJson(bean.getJson(), Archive.class);
                            if (archive != null) {
                                List<Uri> tempUris = createJkda(context, archive);
                                    if (tempUris != null && tempUris.size() > 0) {
                                        imageUris.addAll(tempUris);
                                    }
                            }
                        }
                    }
                }
                handler.obtainMessage(UserListActivity.WHAT_PRINTOK).sendToTarget();
                if (needPrint) {
                    Intent intent = new Intent();
                    intent.setAction("android.intent.action.SEND_MULTIPLE");
                    intent.setType("image/*");
                    intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
                    context.startActivity(intent);
//                    handler.obtainMessage().sendToTarget();
                }
            }
        }).start();
    }

    private static List<Uri> createJkda(Context context, Archive archive) {
        GetArchiveDetail detail = null;
        System.gc();
        // 体检表1的画布，用来画好字。然后保存。
        Bitmap jkdaBitmap = JktjBitmapUtil.getBitmapByResId(context, R.raw.jkda);
        Bitmap jkda = Bitmap.createBitmap(jkdaBitmap.getWidth(),
                jkdaBitmap.getHeight(), Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(jkda);
        canvas.drawBitmap(jkdaBitmap, 0, 0, null);
        jkdaBitmap.recycle();
        Bitmap fengmianBitmap = JktjBitmapUtil.getBitmapByResId(context, R.raw.jkdafengmian);
        Bitmap fengmian = Bitmap.createBitmap(fengmianBitmap.getWidth(),
                fengmianBitmap.getHeight(), Bitmap.Config.ARGB_8888);
        Canvas canvas2 = new Canvas(fengmian);
        canvas2.drawBitmap(fengmianBitmap, 0, 0, null);
        fengmianBitmap.recycle();
        JktjBitmapUtil.drawjkda(canvas, archive);
        JktjBitmapUtil.drawJkdaFengmian(canvas2, archive, detail);
        String name = archive.getPersonName();
        String basePath = FileSaveUtil.getPrintPath_JKDA() + File.separator + name;
        FileSaveUtil.saveBitmap(fengmian, basePath,
                "jkdaFengmian.png");
        FileSaveUtil.saveBitmap(jkda, basePath,
                "jkdaInfo.png");
        fengmian.recycle();
        jkda.recycle();
        ArrayList<Uri> imageUris = new ArrayList<Uri>();
        File f1 = new File(basePath, "jkdaFengmian.png");
        File f2 = new File(basePath, "jkdaInfo.png");
        imageUris.add(Uri.fromFile(f1));
        imageUris.add(Uri.fromFile(f2));
        return imageUris;
    }

    /***
     * 批量生产或打印健康档案
     * @param context
     * @param queryDatas 需要查询的key(time)集合。循环查询每个Archive
     * @param handler  通知是否完成。
     * @param needPrint  是否需要调用printershare打印？
     */
    public static void multiCreateJktj(final Context context, final List<String> queryDatas, final Handler handler, final boolean needPrint
    ) {
        new BackGroundThread(new BackGroundThread.BackGroundTask() {
            @Override
            public void process() {
                ArrayList<Uri> imageUris = new ArrayList<>();
                //循环查询健康档案
                for (int i = 0; i < queryDatas.size(); i++) {
                    String queryTime = queryDatas.get(i);
                    if (!TextUtils.isEmpty(queryTime)) {
                        // 从数据库获取单个健康档案数据。
                        ArchiveBean queryBean = new ArchiveBean();
                        queryBean.setTime(queryTime);
                        ArchiveBean bean = null;
                        List<ArchiveBean> lists = (List<ArchiveBean>) JSONDBService
                                .queryByKey(queryBean);
                        if (lists != null && lists.size() > 0) {
                            bean = lists.get(0);
                            Archive archive = null;
                            archive = new Gson().fromJson(bean.getJson(), Archive.class);
                            if (archive != null) {
                                String idCard = archive.getIdCard();
                                String name = archive.getPersonName();
                                List<Uri> tempUris = createJktj(context, name, idCard);
                                if (needPrint) {
                                    if (tempUris != null && tempUris.size() > 0) {
                                        imageUris.addAll(tempUris);
                                    }
                                }
                            }
                        }
                    }
                }

                handler.obtainMessage(UserListActivity.WHAT_PRINTOK).sendToTarget();
                if (needPrint) {
                    Intent intent = new Intent();
                    intent.setAction("android.intent.action.SEND_MULTIPLE");
                    intent.setType("image/*");
                    intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
                    context.startActivity(intent);
//                    handler.obtainMessage().sendToTarget();
                }
            }
        }).start();
    }

    //根据身份证获取最新的体检表
    private static List<Uri> createJktj(Context context, String name, String idCard) {
        ArrayList<Uri> imageUris = new ArrayList<Uri>();
        base_info base = new base_info();
        base.setIdCard(idCard);
        //获取某人的身份证号，然后查询该人的体检表
        List<base_info> lists = (List<base_info>) DBService.queryByIdCard(base);
        if (lists != null && lists.size() > 0) {
            base_info bi = lists.get(lists.size() - 1);
            String date = bi.getCheckDate();
            String time = bi.getTime();
            base_info b = new base_info();
            b.setTime(time);
            Examination e = new Examination();
            e.setTime(time);
            NonimmuneInoculation n = new NonimmuneInoculation();
            n.setTime(time);
            AccessoryExamination a = new AccessoryExamination();
            a.setTime(time);
            HealthAssessment h = new HealthAssessment();
            h.setTime(time);
            LifestySituation l = new LifestySituation();
            l.setTime(time);
            MedicineSituation m = new MedicineSituation();
            m.setTime(time);
            InhospitalSituation i = new InhospitalSituation();
            i.setTime(time);
            /** 基本情况 */
            base_info mjktj_baseInfo = null;
            /** 查体 */
            Examination mjktj_Examination = null;
            /** 辅助检查 */
            AccessoryExamination mjktj_AccessoryExamination = null;
            /** 健康评价表 */
            HealthAssessment mjktj_HealthAssessment = null;
            /** 生活方式 */
            LifestySituation mjktj_LifestySituation = null;
            /** 住院用药情况 */
            MedicineSituation mjktj_MedicineSituation = null;
            /** 住院治疗情况 */
            InhospitalSituation mjktj_InhospitalSituation = null;
            /** 非免疫接种 */
            NonimmuneInoculation mjktj_NonimmuneInoculation = null;
            List<base_info> bs = (List<base_info>) DBService.queryByKey(b);
            if (bs.size() > 0) {
                mjktj_baseInfo = bs.get(0);
            }
            /** 查体 */
            List<Examination> es = (List<Examination>) DBService.queryByKey(e);
            if (es.size() > 0) {
                mjktj_Examination = es.get(0);
            }
            List<NonimmuneInoculation> ns = (List<NonimmuneInoculation>) DBService
                    .queryByKey(n);
            if (ns.size() > 0) {
                mjktj_NonimmuneInoculation = ns.get(0);
            }
            List<AccessoryExamination> as = (List<AccessoryExamination>) DBService
                    .queryByKey(a);
            if (as.size() > 0) {
                mjktj_AccessoryExamination = as.get(0);
            }
            List<HealthAssessment> hs = (List<HealthAssessment>) DBService
                    .queryByKey(h);
            if (hs.size() > 0) {
                mjktj_HealthAssessment = hs.get(0);
            }
            List<LifestySituation> ls = (List<LifestySituation>) DBService
                    .queryByKey(l);
            if (ls.size() > 0) {
                mjktj_LifestySituation = ls.get(0);
            }
            List<MedicineSituation> ms = (List<MedicineSituation>) DBService
                    .queryByKey(m);
            if (ms.size() > 0) {
                mjktj_MedicineSituation = ms.get(0);
            }
            List<InhospitalSituation> is = (List<InhospitalSituation>) DBService
                    .queryByKey(i);
            if (is.size() > 0) {
                mjktj_InhospitalSituation = is.get(0);
            }
            // 体检表1的画布，用来画好字。然后保存。
            Bitmap bitmap1 = JktjBitmapUtil.getBitmapByResId(context, R.raw.tijianbiao1);
            Bitmap tijianbiao1 = Bitmap.createBitmap(bitmap1.getWidth(),
                    bitmap1.getHeight(), Bitmap.Config.ARGB_4444);
            Canvas canvas1 = new Canvas(tijianbiao1);
            canvas1.drawBitmap(bitmap1, 0, 0, null);
            bitmap1.recycle();
            // 体检表2
            Bitmap bitmap2 = JktjBitmapUtil.getBitmapByResId(context, R.raw.tijianbiao2);
            Bitmap tijianbiao2 = Bitmap.createBitmap(bitmap2.getWidth(),
                    bitmap2.getHeight(), Bitmap.Config.ARGB_4444);
            Canvas canvas2 = new Canvas(tijianbiao2);
            canvas2.drawBitmap(bitmap2, 0, 0, null);
            bitmap2.recycle();
            // 体检表3
            Bitmap bitmap3 = JktjBitmapUtil.getBitmapByResId(context, R.raw.tijianbiao3);
            Bitmap tijianbiao3 = Bitmap.createBitmap(bitmap3.getWidth(),
                    bitmap3.getHeight(), Bitmap.Config.ARGB_4444);
            Canvas canvas3 = new Canvas(tijianbiao3);
            canvas3.drawBitmap(bitmap3, 0, 0, null);
            bitmap3.recycle();
            // 体检表3
            Bitmap bitmap4 = JktjBitmapUtil.getBitmapByResId(context, R.raw.tijianbiao4);
            Bitmap tijianbiao4 = Bitmap.createBitmap(bitmap4.getWidth(),
                    bitmap4.getHeight(), Bitmap.Config.ARGB_4444);
            Canvas canvas4 = new Canvas(tijianbiao4);
            canvas4.drawBitmap(bitmap4, 0, 0, null);
            bitmap4.recycle();
            drawBaseInfo(canvas1, mjktj_baseInfo, mjktj_LifestySituation, name);
            drawBitmap2(canvas2, mjktj_AccessoryExamination, mjktj_Examination, name);
            drawBitmap3(canvas3, mjktj_baseInfo, mjktj_AccessoryExamination, mjktj_Examination,
                    mjktj_HealthAssessment, name);
            drawBitmap4(canvas4, mjktj_baseInfo, mjktj_HealthAssessment, name);
            String basePath = FileSaveUtil.getPrintPath_JKTJ() + File.separator + name;
            FileSaveUtil.saveBitmap(tijianbiao1, basePath,
                    "tijianbiao1.png");
            FileSaveUtil.saveBitmap(tijianbiao2, basePath,
                    "tijianbiao2.png");
            FileSaveUtil.saveBitmap(tijianbiao3, basePath,
                    "tijianbiao3.png");
            FileSaveUtil.saveBitmap(tijianbiao4, basePath,
                    "tijianbiao4.png");
            tijianbiao1.recycle();
            tijianbiao2.recycle();
            tijianbiao3.recycle();
            tijianbiao4.recycle();
            File f1 = new File(basePath, "tijianbiao1.png");
            File f2 = new File(basePath, "tijianbiao2.png");
            File f3 = new File(basePath, "tijianbiao3.png");
            File f4 = new File(basePath, "tijianbiao4.png");
            imageUris.add(Uri.fromFile(f1));
            imageUris.add(Uri.fromFile(f2));
            imageUris.add(Uri.fromFile(f3));
            imageUris.add(Uri.fromFile(f4));
            return imageUris;
        }
        return null;
    }

    public static void drawBaseInfo(Canvas canvas, base_info baseInfo,
                                    LifestySituation lifestySituation, String personName) {

        base_info dataBean = baseInfo;
        String name = personName;
        textPaint.setTextSize(32);
        canvas.drawText(name, 400, 315, textPaint);
        textPaint.setTextSize(textSize);
        String checkDate = dataBean.getCheckDate();
        if (checkDate.length() >= 10) {
            String year = checkDate.substring(0, 4);
            String month = checkDate.substring(5, 7);
            String day = checkDate.substring(8, 10);
            canvas.drawText(year, 430, 380, textPaint);
            canvas.drawText(month, 580, 380, textPaint);
            canvas.drawText(day, 680, 380, textPaint);
        }
        canvas.drawText(dataBean.getDoctorName(), 1200, 380, textPaint);
        // 症状
        String grzz = dataBean.getSymptom();
        String[] grzzs = grzz.split(",");
        for (int i = 0; i < grzzs.length; i++) {
            try {
                if (TextUtils.isEmpty(grzzs[i])) {
                    continue;
                }
                if (grzzs[i].length() >= 2) {
                    grzzs[i] = grzzs[i].replace("0", "");
                    canvas.drawText(grzzs[i], 1130 + 43 * i, 614,
                            smallTextPaint);
                }
                // zhengzhuang24_other.setText();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        canvas.drawText(dataBean.getSymptomOt(), 1160, 560, textPaint);
        canvas.drawText(dataBean.getTemperature(), 600, 665, textPaint);
        canvas.drawText(dataBean.getBreathe(), 600, 735, textPaint);// 呼吸频率
        canvas.drawText(dataBean.getPulse(), 1170, 665, textPaint);// 脉率
        canvas.drawText(dataBean.getConstriction(), 1270, 715, textPaint);// 收缩压
        canvas.drawText(dataBean.getDiastolic(), 1400, 715, textPaint);// 舒张压
        canvas.drawText(dataBean.getConstriction_L(), 1270, 760, textPaint);// 收缩压右边
        canvas.drawText(dataBean.getDiastolic_L(), 1400, 760, textPaint);// 舒张压右边
        canvas.drawText(dataBean.getHeight(), 600, 805, textPaint);// 身高
        canvas.drawText(dataBean.getWeight(), 1170, 805, textPaint);// 体重
        canvas.drawText(dataBean.getWaistline(), 600, 853, textPaint);// 腰围
        canvas.drawText(dataBean.getBmi(), 1170, 853, textPaint);// bmi
        canvas.drawText(dataBean.getSelfCare(), 1548, 915, smallTextPaint);// bmi
        canvas.drawText(dataBean.getHealthStatus(), 1548, 1008, smallTextPaint);// 健康情况
        canvas.drawText(dataBean.getCognitive(), 1548, 1102, smallTextPaint);// 老人认知功能
        canvas.drawText(dataBean.getCognitiveZf(), 1120, 1120, textPaint);// 老人认知功能评分
        canvas.drawText(dataBean.getEmotion(), 1548, 1173, smallTextPaint);// 老人情感状态
        canvas.drawText(dataBean.getEmotionZf(), 1120, 1220, textPaint);// 老人情感状态总分
        canvas.drawText(lifestySituation.getPhysicalExerciseFrequency(), 1548,
                1260, smallTextPaint);// 体育频率
        canvas.drawText(lifestySituation.getEveryPhysicalExerciseTime(), 855,
                1310, textPaint);//
        canvas.drawText(lifestySituation.getInsistexercisetime(), 1325, 1310,
                textPaint);//
        canvas.drawText(lifestySituation.getExerciseStyle(), 800, 1361,
                textPaint);//
        String ysxg = lifestySituation.getDietaryHabit();
        if (!TextUtils.isEmpty(ysxg)) {
            String[] ysxg01 = ysxg.split(",");
            for (int i = 0; i < ysxg01.length; i++) {
                canvas.drawText(ysxg01[i], 1460 + 43 * i, 1402, smallTextPaint);//
            }
        }
        canvas.drawText(lifestySituation.getWehtherSmoke(), 1548, 1450,
                smallTextPaint);// 吸烟状况
        canvas.drawText(lifestySituation.getSmokes(), 845, 1503, textPaint);//
        canvas.drawText(lifestySituation.getBeginSmokeTime(), 845, 1554,
                textPaint);// 开始吸烟年龄
        canvas.drawText(lifestySituation.getStopSmokeTime(), 1364, 1554,
                textPaint);// 戒烟年龄
        canvas.drawText(lifestySituation.getDrinkingFrequency(), 1548, 1602,
                smallTextPaint);// 饮酒频率
        canvas.drawText(lifestySituation.getAlcoholConsumption(), 845, 1652,
                textPaint);// 日饮酒量
        canvas.drawText(lifestySituation.getWhetherDrink(), 1548, 1703,
                smallTextPaint);// 是不是解救了。
        canvas.drawText(lifestySituation.getStopDrinkingTime(), 1207, 1703,
                textPaint);// 戒酒年龄。
        canvas.drawText(lifestySituation.getBeginToDrinkTime(), 845, 1768,
                textPaint);// 开始饮酒年龄
        canvas.drawText(lifestySituation.getIsDrink(), 1548, 1757,
                smallTextPaint);// 是否醉酒
        String yjzl = lifestySituation.getMainDrinkingVvarieties();
        if (!TextUtils.isEmpty(yjzl)) {
            String[] yjzl01 = yjzl.split(",");
            for (int i = 0; i < yjzl01.length; i++) {
                if (yjzl01[i].equals("9")) {
                    yjzl01[i] = "5";
                }
                canvas.drawText(yjzl01[i], 1414 + 45 * i, 1811, smallTextPaint);// 饮酒种类
            }
        }
        canvas.drawText(lifestySituation.getDrinkOther(), 1246, 1811, textPaint);//
        canvas.drawText(lifestySituation.getJobs(), 755, 1853, textPaint);// 工种
        canvas.drawText(lifestySituation.getWorkTime(), 967, 1853, textPaint);// 工种时间
        canvas.drawText(lifestySituation.getDust(), 803, 1891, textPaint);// 粉尘
        canvas.drawText(lifestySituation.getDustPro(), 1548, 1862,
                smallTextPaint);// 粉尘1,2
        canvas.drawText(lifestySituation.getDustProDesc(), 1224, 1895,
                textPaint);// 粉尘描述
        canvas.drawText(lifestySituation.getRay(), 803, 1931, textPaint);// 放射
        canvas.drawText(lifestySituation.getRayPro(), 1548, 1906,
                smallTextPaint);// 放射1 2
        canvas.drawText(lifestySituation.getRayProDesc(), 1224, 1932, textPaint);// 放射描述
        canvas.drawText(lifestySituation.getPhysicalFactor(), 803, 1969,
                textPaint);// 物理
        canvas.drawText(lifestySituation.getPhysicalFactorPro() == null ? ""
                        : lifestySituation.getPhysicalFactorPro(), 1548, 1952,
                smallTextPaint);// 物理1 2
        canvas.drawText(lifestySituation.getPhysicalFactorProDesc(), 1224,
                1972, textPaint);// 物理描述
        canvas.drawText(lifestySituation.getChemicals(), 803, 2009, textPaint);// 化学
        canvas.drawText(lifestySituation.getChemicalsPro(), 1548, 1996,
                smallTextPaint);// 化学1 2
        canvas.drawText(lifestySituation.getChemicalsProDesc(), 1224, 2010,
                textPaint);// 化学描述
        canvas.drawText(lifestySituation.getOther(), 803, 2046, textPaint);// 其他
        canvas.drawText(lifestySituation.getOtherPro() == null ? ""
                : lifestySituation.getOtherPro(), 1548, 2043, smallTextPaint);// 其他1
        canvas.drawText(lifestySituation.getOtherProDesc(), 1224, 2047,
                textPaint);// 其他描述
    }

    /***
     * 辅助检查
     *
     * @param canvas
     * @param accessoryExamination
     */
    public static void drawBitmap2(Canvas canvas,
                                   AccessoryExamination accessoryExamination, Examination examination, String personName) {
        AccessoryExamination uploadBean = accessoryExamination;
        // 口唇
        canvas.drawText(personName, 171, 162, textPaint);// 姓名
        canvas.drawText(uploadBean.getLip(), 1548, 205, smallTextPaint);// 其
        canvas.drawText(uploadBean.getPharyngeal(), 1548, 250, smallTextPaint);// 齿列
        canvas.drawText(uploadBean.getDenture(), 1548, 296, smallTextPaint);// 咽喉部
        canvas.drawText(uploadBean.getLeftEye(), 592, 351, textPaint);// 左眼
        canvas.drawText(uploadBean.getRightEye(), 760, 351, textPaint);// 右眼
        canvas.drawText(uploadBean.getRecLeftEye(), 1110, 351, textPaint);// 矫正左眼
        canvas.drawText(uploadBean.getRecRightEye(), 1315, 351, textPaint);// 矫正右眼
        canvas.drawText(uploadBean.getHearing(), 1548, 410, smallTextPaint);// 听力
        canvas.drawText(uploadBean.getMotion(), 1548, 466, smallTextPaint);// 运动能力
        canvas.drawText(examination.getFundus(), 1548, 521, smallTextPaint);// 眼底
        canvas.drawText(examination.getFundusDesc(), 724, 523, textPaint);// 眼底描述
        canvas.drawText(examination.getSkin(), 1548, 587, smallTextPaint);// 皮肤
        canvas.drawText(examination.getSkinDesc(), 1294, 589, textPaint);//
        canvas.drawText(examination.getSclera(), 1548, 657, smallTextPaint);// 巩膜
        canvas.drawText(examination.getScleraDesc(), 929, 657, textPaint);// 巩膜
        canvas.drawText(examination.getLymphnodes(), 1548, 718, smallTextPaint);// 淋巴结
        canvas.drawText(examination.getLymphnodesDesc(), 1047, 721, textPaint);// 淋巴结描述
        canvas.drawText(examination.getBarrelChest(), 1548, 780, smallTextPaint);// 桶状胸
        canvas.drawText(examination.getBreathSound(), 1548, 837, smallTextPaint);// 呼吸音
        canvas.drawText(examination.getBreathSoundDesc(), 841, 840, textPaint);// 呼吸音描述
        canvas.drawText(examination.getBreathSound(), 1548, 895, smallTextPaint);// 啰音
        canvas.drawText(examination.getBreathSoundDesc(), 1117, 899, textPaint);// 啰音描述
        canvas.drawText(examination.getRhythm(), 1548, 951, smallTextPaint);// 心率齐不齐
        canvas.drawText(examination.getHeartRate(), 608, 954, textPaint);// 心率次数
        canvas.drawText(examination.getHeartMurmur(), 1548, 995, smallTextPaint);// 杂音
        canvas.drawText(examination.getHeartMurmurDesc(), 849, 998, textPaint);// 杂音描述
        canvas.drawText(examination.getHeartMurmur(), 1548, 1047,
                smallTextPaint);// 压痛
        canvas.drawText(examination.getHeartMurmurDesc(), 751, 1045, textPaint);// 压痛描述
        canvas.drawText(examination.getAdbominAlmass(), 1548, 1092,
                smallTextPaint);// 包块
        canvas.drawText(examination.getAdbominAlmassDesc(), 751, 1092,
                textPaint);// 包块描述
        canvas.drawText(examination.getLiverBig(), 1548, 1138, smallTextPaint);// 肝大
        canvas.drawText(examination.getLiverBigDesc(), 751, 1136, textPaint);// 肝大描述
        canvas.drawText(examination.getSplenomegaly(), 1548, 1184,
                smallTextPaint);// 脾大
        canvas.drawText(examination.getSplenomegalyDesc(), 751, 1183, textPaint);// 脾大描述
        canvas.drawText(examination.getDullness(), 1548, 1229, smallTextPaint);// 移动性浊音
        canvas.drawText(examination.getDullnessDesc(), 848, 1228, textPaint);// 移动性浊音描述
        canvas.drawText(examination.getEdema(), 1548, 1274, smallTextPaint);// 下肢水肿
        canvas.drawText(examination.getFootPulse(), 1548, 1323, smallTextPaint);// 足背动脉搏动
        String gmzz = examination.getDre();
        String[] gmzzs = gmzz.split(",");
        for (int i = 0; i < gmzzs.length; i++) {
            if (gmzzs[i].equals("9")) {
                gmzzs[i] = "5";
            }
            canvas.drawText(gmzzs[i], 1548, 1374, smallTextPaint);// 肛门指诊
        }
        canvas.drawText(examination.getDreDesc(), 1296, 1374, textPaint);// 肛门指诊描述

        String rx = examination.getBreast();
        String[] rxs = rx.split(",");
        for (int i = 0; i < rxs.length; i++) {
            if (rxs[i].equals("9")) {
                rxs[i] = "5";
            }
            canvas.drawText(rxs[i], 1413 + i * 45, 1446, smallTextPaint);// ruxian
        }
        canvas.drawText(examination.getBreastDesc(), 1218, 1449, textPaint);// 乳腺描述
        canvas.drawText(examination.getVulva(), 1548, 1508, smallTextPaint);// 外阴
        canvas.drawText(examination.getVulvaDesc(), 806, 1508, textPaint);// 外阴描述
        canvas.drawText(examination.getVulva(), 1548, 1572, smallTextPaint);// 阴道
        canvas.drawText(examination.getVulvaDesc(), 806, 1575, textPaint);// 阴道描述
        canvas.drawText(examination.getCervix(), 1548, 1636, smallTextPaint);// 宫颈
        canvas.drawText(examination.getCervixDesc(), 806, 1640, textPaint);// 宫颈描述
        canvas.drawText(examination.getPalace(), 1548, 1699, smallTextPaint);// 宫体
        canvas.drawText(examination.getPalaceDesc(), 806, 1704, textPaint);// 宫体描述
        canvas.drawText(examination.getAttachment(), 1548, 1763, smallTextPaint);// 附件
        canvas.drawText(examination.getAttachmentDesc(), 806, 1767, textPaint);// 附件描述
        canvas.drawText(examination.getTjother(), 524, 1845, textPaint);// 其他
        canvas.drawText(accessoryExamination.getHgb(), 639, 1897, textPaint);// 血红蛋白
        canvas.drawText(accessoryExamination.getWbc(), 933, 1897, textPaint);// 白细胞
        canvas.drawText(accessoryExamination.getPlatelet(), 1239, 1897,
                textPaint);// 血小板
        canvas.drawText(accessoryExamination.getBloodOther(), 639, 1946,
                textPaint);// 血小常规其他
        canvas.drawText(accessoryExamination.getProteinuria(), 611, 1991,
                textPaint);// 尿蛋白
        canvas.drawText(accessoryExamination.getGlu(), 799, 1991, textPaint);// 尿糖
        canvas.drawText(accessoryExamination.getDka(), 1028, 1991, textPaint);// 尿酮体
        canvas.drawText(accessoryExamination.getOc(), 1272, 1991, textPaint);// 尿潜血
        canvas.drawText(accessoryExamination.getFbs(), 934, 2088, textPaint);// 餐前血糖
        canvas.drawText(accessoryExamination.getPbs(), 532, 2088, textPaint);// 餐后血糖
        canvas.drawText(accessoryExamination.getUrineOther(), 604, 2036,
                textPaint);// 尿常规其他
    }

    public static void drawBitmap3(Canvas canvas, base_info baseInfo,
                                   AccessoryExamination accessoryExamination, Examination examination,
                                   HealthAssessment healthAssessment, String personName) {

        canvas.drawText(personName, 171, 162, textPaint);// 姓名
        canvas.drawText(accessoryExamination.getEcg(), 1548, 251,
                smallTextPaint);// 心电图
        // 如果心电结论大于20个字，就换行
        canvas.drawText(accessoryExamination.getEcgText(), 721, 210, textPaint);// 心电图描述
        canvas.drawText(accessoryExamination.getMalb(), 540, 354, textPaint);// 尿微量白蛋白
        canvas.drawText(accessoryExamination.getFob(), 1548, 408,
                smallTextPaint);// 大便潜血
        canvas.drawText(accessoryExamination.getHba1c(), 540, 471, textPaint);// 糖化血蛋白
        canvas.drawText(accessoryExamination.getHbsag(), 1548, 543,
                smallTextPaint);// 乙型肝炎表面抗原
        canvas.drawText(accessoryExamination.getAlt(), 760, 617, textPaint);// 血清谷丙转氨酶
        canvas.drawText(accessoryExamination.getAst(), 1201, 617, textPaint);// 血清谷草转氨酶
        canvas.drawText(accessoryExamination.getAlb(), 622, 662, textPaint);// 血蛋白
        canvas.drawText(accessoryExamination.getTbil(), 1139, 662, textPaint);// 总胆红素
        canvas.drawText(accessoryExamination.getDbil(), 677, 706, textPaint);// 结合胆红素
        canvas.drawText(accessoryExamination.getCr(), 668, 755, textPaint);// 血清肌酐
        canvas.drawText(accessoryExamination.getBun(), 1174, 755, textPaint);// 血尿素氮
        canvas.drawText(accessoryExamination.getKalemia(), 668, 799, textPaint);// 血钾浓度
        canvas.drawText(accessoryExamination.getNatremia(), 1174, 799,
                textPaint);// 血钠浓度
        canvas.drawText(accessoryExamination.getTc(), 645, 848, textPaint);// 总胆固醇
        canvas.drawText(accessoryExamination.getTg(), 1030, 848, textPaint);// 甘油三酯
        canvas.drawText(accessoryExamination.getLdl(), 866, 894, textPaint);// 血清低密度脂蛋白胆固醇
        canvas.drawText(accessoryExamination.getHdl(), 866, 937, textPaint);// 血清高密度脂蛋白胆固醇
        canvas.drawText(accessoryExamination.getX(), 1548, 984, smallTextPaint);// 胸部X线
        canvas.drawText(accessoryExamination.getXText(), 734, 990, textPaint);// 胸部X线描述
        canvas.drawText(accessoryExamination.getB(), 1548, 1036, smallTextPaint);// B超
        canvas.drawText(accessoryExamination.getBText(), 734, 1039, textPaint);// B超描述
        canvas.drawText(accessoryExamination.getPs(), 1548, 1089,
                smallTextPaint);// 宫颈涂片
        canvas.drawText(accessoryExamination.getPsText(), 734, 1094, textPaint);// 宫颈涂片描述
        canvas.drawText(accessoryExamination.getFuOther(), 555, 1144, textPaint);// 其他
        String recognize = healthAssessment.getRecognize();
        if (!TextUtils.isEmpty(recognize)) {
            String[] rs = recognize.split(",");
            for (int i = 0; i < rs.length; i++) {
                switch (rs[i]) {
                    case "11":
                        canvas.drawText("1", 1548, 1185, smallTextPaint);//
                        break;
                    case "12":
                        canvas.drawText("2", 1548, 1185, smallTextPaint);//
                        break;
                    case "21":
                        canvas.drawText("1", 1548, 1228, smallTextPaint);//
                        break;
                    case "22":
                        canvas.drawText("2", 1548, 1228, smallTextPaint);//
                        break;
                    case "31":
                        canvas.drawText("1", 1548, 1272, smallTextPaint);//
                        break;
                    case "32":
                        canvas.drawText("2", 1548, 1272, smallTextPaint);//
                        break;
                    case "41":
                        canvas.drawText("1", 1548, 1324, smallTextPaint);//
                        break;
                    case "42":
                        canvas.drawText("2", 1548, 1324, smallTextPaint);//
                        break;
                    case "51":
                        canvas.drawText("1", 1548, 1376, smallTextPaint);//
                        break;
                    case "52":
                        canvas.drawText("2", 1548, 1376, smallTextPaint);//
                        break;
                    case "61":
                        canvas.drawText("1", 1548, 1434, smallTextPaint);//
                        break;
                    case "62":
                        canvas.drawText("2", 1548, 1434, smallTextPaint);//
                        break;
                    case "71":
                        canvas.drawText("1", 1548, 1489, smallTextPaint);//
                        break;
                    case "72":
                        canvas.drawText("2", 1548, 1489, smallTextPaint);//
                        break;
                    case "81":
                        canvas.drawText("1", 1548, 1547, smallTextPaint);//
                        break;
                    case "82":
                        canvas.drawText("2", 1548, 1547, smallTextPaint);//
                        break;
                    case "91":
                        canvas.drawText("1", 1548, 1603, smallTextPaint);//
                        break;
                    case "92":
                        canvas.drawText("2", 1548, 1603, smallTextPaint);//
                        break;
                    default:
                        break;
                }
            }
        }
        // 脑血管疾病
        String NXGJB1 = baseInfo.getCerebrovascularDiseases();
        if (NXGJB1 != null) {
            String[] nxgjb = NXGJB1.split(",");
            for (int i = 0; i < nxgjb.length; i++) {
                if (nxgjb[i].equals("9")) {
                    nxgjb[i] = "6";
                }
                if (!TextUtils.isEmpty(nxgjb[i])) {
                    canvas.drawText(nxgjb[i], 1394 + i * 40, 1693,
                            smallTextPaint);//
                }
            }
        }
        canvas.drawText(baseInfo.getOthercerebrovascularDiseases(), 619, 1699,
                textPaint);// 脑血管疾病其他

        // 肾脏疾病
        String SZJB01 = baseInfo.getKidneyDiseases();
        if (SZJB01 != null) {
            String[] szjb01 = SZJB01.split(",");
            for (int i = 0; i < szjb01.length; i++) {
                if (szjb01[i].equals("9")) {
                    szjb01[i] = "6";
                }
                if (!TextUtils.isEmpty(szjb01[i])) {
                    canvas.drawText(szjb01[i], 1394 + i * 40, 1800,
                            smallTextPaint);//
                }
            }
        }
        canvas.drawText(baseInfo.getOtherkidneyDiseases(), 619, 1806, textPaint);// 肾脏疾病其他
        // 心脏疾病
        String XZJB01 = baseInfo.getHeartDisease();
        if (XZJB01 != null) {
            String[] xzjb01 = XZJB01.split(",");
            for (int i = 0; i < xzjb01.length; i++) {
                if (xzjb01[i].equals("9")) {
                    xzjb01[i] = "7";
                }
                if (!TextUtils.isEmpty(xzjb01[i])) {
                    canvas.drawText(xzjb01[i], 1394 + i * 40, 1906,
                            smallTextPaint);//
                }
            }
        }
        canvas.drawText(baseInfo.getOtherheartDisease(), 817, 1910, textPaint);// 肾脏疾病其他
        // 血管疾病
        String XGJB01 = baseInfo.getVascularDisease();
        if (XGJB01 != null) {
            String[] xgjb01 = XGJB01.split(",");
            for (int i = 0; i < xgjb01.length; i++) {
                if (xgjb01[i].equals("9")) {
                    xgjb01[i] = "4";
                }
                if (!TextUtils.isEmpty(xgjb01[i])) {
                    canvas.drawText(xgjb01[i], 1450 + i * 42, 1955,
                            smallTextPaint);//
                }
            }
        }
        canvas.drawText(baseInfo.getOtherVascularDisease(), 1182, 1961,
                textPaint);// 血管疾病其他
        // eyeDiseases眼部疾病
        String YBJB01 = baseInfo.getEyeDiseases();
        if (YBJB01 != null) {
            String[] ybjb01 = YBJB01.split(",");
            for (int i = 0; i < ybjb01.length; i++) {
                if (ybjb01[i].equals("9")) {
                    ybjb01[i] = "5";
                }
                if (!TextUtils.isEmpty(ybjb01[i])) {
                    canvas.drawText(ybjb01[i], 1458 + i * 42, 2035,
                            smallTextPaint);//
                }
            }
        }
        canvas.drawText(baseInfo.getOthereyeDiseases(), 624, 2057, textPaint);// 眼部疾病其他
        canvas.drawText(baseInfo.getNeurologicalDiseases(), 1548, 2113,
                smallTextPaint);// 精神系统疾病
        canvas.drawText(baseInfo.getNeurologicalDiseasesDesc(), 719, 2116,
                textPaint);// 精神系统疾病描述
        canvas.drawText(baseInfo.getOtherDiseasesone(), 1548, 2168,
                smallTextPaint);// 其他系统疾病
        canvas.drawText(baseInfo.getOtherDiseasesoneDesc(), 719, 2170,
                textPaint);// 其他系统疾病描述
    }

    public static void drawBitmap4(Canvas canvas, base_info baseInfo,
                                   HealthAssessment healthAssessment, String personName) {
        List<InhospitalSituation> inhospitalSituations = baseInfo
                .getInhospitalSituations();
        canvas.drawText(personName, 171, 162, textPaint);// 姓名
        textPaint.setTextSize(23);
        if (inhospitalSituations != null && inhospitalSituations.size() > 0) {
            int type1count = 0;
            int type2count = 0;
            for (int i = 0; i < inhospitalSituations.size(); i++) {
                InhospitalSituation bean = inhospitalSituations.get(i);
                if (bean.getType().equals("1")) {
                    if (type1count == 0) {
                        canvas.drawText(bean.getInhospitalDate(), 511, 265,
                                textPaint);//
                        canvas.drawText(bean.getOuthospitalDate(), 656, 265,
                                textPaint);//
                        canvas.drawText(bean.getInhospitalReason(), 794, 265,
                                textPaint);//
                        canvas.drawText(bean.getMedicalestablishmentName(),
                                988, 265, textPaint);//
                        canvas.drawText(bean.getMedicalrecordNumber(), 1291,
                                265, textPaint);//
                        type1count = 1;
                    } else if (type1count == 1) {
                        canvas.drawText(bean.getInhospitalDate(), 511, 317,
                                textPaint);//
                        canvas.drawText(bean.getOuthospitalDate(), 656, 317,
                                textPaint);//
                        canvas.drawText(bean.getInhospitalReason(), 794, 317,
                                textPaint);//
                        canvas.drawText(bean.getMedicalestablishmentName(),
                                988, 317, textPaint);//
                        canvas.drawText(bean.getMedicalrecordNumber(), 1291,
                                317, textPaint);//
                        type1count = 2;
                    }
                } else if (bean.getType().equals("2")) {
                    if (type2count == 0) {
                        canvas.drawText(bean.getInhospitalDate(), 511, 422,
                                textPaint);//
                        canvas.drawText(bean.getOuthospitalDate(), 656, 422,
                                textPaint);//
                        canvas.drawText(bean.getInhospitalReason(), 794, 422,
                                textPaint);//
                        canvas.drawText(bean.getMedicalestablishmentName(),
                                988, 422, textPaint);//
                        canvas.drawText(bean.getMedicalrecordNumber(), 1291,
                                422, textPaint);//
                        type2count = 1;
                    } else if (type2count == 1) {
                        canvas.drawText(bean.getInhospitalDate(), 511, 472,
                                textPaint);//
                        canvas.drawText(bean.getOuthospitalDate(), 656, 472,
                                textPaint);//
                        canvas.drawText(bean.getInhospitalReason(), 794, 472,
                                textPaint);//
                        canvas.drawText(bean.getMedicalestablishmentName(),
                                988, 472, textPaint);//
                        canvas.drawText(bean.getMedicalrecordNumber(), 1291,
                                472, textPaint);//
                        type2count = 2;
                    }
                }
            }
        }
        textPaint.setTextSize(textSize);
        // 用药情况
        List<MedicineSituation> medicineSituations = baseInfo
                .getMedicineSituations();
        for (int i = 0; i < medicineSituations.size() && i < 6; i++) {
            MedicineSituation bean = medicineSituations.get(i);
            canvas.drawText(bean.getMedicine(), 284, 644 + 63 * i, textPaint);//
            canvas.drawText(bean.getUse(), 521, 644 + 63 * i, textPaint);//
            canvas.drawText(bean.getEachDose(), 730, 644 + 63 * i, textPaint);//
            canvas.drawText(bean.getUseDate(), 852, 644 + 63 * i, textPaint);//
            canvas.drawText(bean.getMedicineYield(), 1273, 644 + 63 * i,
                    textPaint);//
        }
        // 免疫接种情况
        List<NonimmuneInoculation> nonimmuneInoculations = baseInfo
                .getNonimmuneInoculations();
        for (int i = 0; i < nonimmuneInoculations.size(); i++) {
            NonimmuneInoculation bean = nonimmuneInoculations.get(i);
            canvas.drawText(bean.getName(), 284, 1083 + 63 * i, textPaint);//
            canvas.drawText(bean.getInoculationDate(), 521, 1083 + 63 * i,
                    textPaint);//
            canvas.drawText(bean.getInoculationUnit(), 740, 1083 + 63 * i,
                    textPaint);//
        }
        // 体检异常
        canvas.drawText(healthAssessment.getAbnormality(), 1548, 1264,
                smallTextPaint);//
        canvas.drawText(healthAssessment.getAbnormality1(), 381, 1357,
                textPaint);//
        canvas.drawText(healthAssessment.getAbnormality2(), 381, 1402,
                textPaint);//
        canvas.drawText(healthAssessment.getAbnormality3(), 381, 1449,
                textPaint);//
        canvas.drawText(healthAssessment.getAbnormality4(), 381, 1486,
                textPaint);//
        // 健康指导
        String jkzd_sb = healthAssessment.getMana();
        String[] jkzds = jkzd_sb.split(",");
        for (int i = 0; i < jkzds.length; i++) {
            canvas.drawText(jkzds[i], 646 + 45 * i, 1763, smallTextPaint);//
        }
        // 危险因素
        String wxys = healthAssessment.getRiskfactorsControl();
        String[] wxyss = wxys.split(",");
        for (int i = 0; i < wxyss.length; i++) {
            canvas.drawText(wxyss[i], 1079 + 45 * i, 1569, smallTextPaint);//
        }
        // 减重目标
        canvas.drawText(healthAssessment.getTargetWeight(), 1030, 1685,
                textPaint);//
        // 建议接种疫苗
        canvas.drawText(healthAssessment.getVaccine(), 1030, 1742, textPaint);//
        // 其他
        canvas.drawText(healthAssessment.getPjOther(), 942, 1790, textPaint);//
    }

    /***
     * 批量生产或打印测量记录
     * @param context
     * @param queryDatas 需要查询的key(time)集合。循环查询每个Archive
     * @param handler  通知是否完成。
     * @param needPrint  是否需要调用printershare打印？
     */
    public static void multiCreateCLJL(final Context context, final List<String> queryDatas, final Handler handler, final boolean needPrint
    ) {
        new BackGroundThread(new BackGroundThread.BackGroundTask() {
            @Override
            public void process() {
                ArrayList<Uri> imageUris = new ArrayList<>();
                //循环查询健康档案
                for (int i = 0; i < queryDatas.size(); i++) {
                    String queryTime = queryDatas.get(i);
                    if (!TextUtils.isEmpty(queryTime)) {
                        // 从数据库获取单个健康档案数据。
                        ArchiveBean queryBean = new ArchiveBean();
                        queryBean.setTime(queryTime);
                        ArchiveBean bean = null;
                        List<ArchiveBean> lists = (List<ArchiveBean>) JSONDBService
                                .queryByKey(queryBean);
                        if (lists != null && lists.size() > 0) {
                            bean = lists.get(0);
                            Archive archive = null;
                            archive = new Gson().fromJson(bean.getJson(), Archive.class);
                            if (archive != null) {
                                String idCard = archive.getIdCard();
                                String name = archive.getPersonName();
                                List<Uri> tempUris = createJKCL(context, idCard, archive);
                                if (tempUris != null && tempUris.size() > 0) {
                                    imageUris.addAll(tempUris);
                                }
                            }
                        }
                    }
                }
                handler.obtainMessage(UserListActivity.WHAT_PRINTOK).sendToTarget();
                if (needPrint) {
                    Intent intent = new Intent();
                    intent.setAction("android.intent.action.SEND_MULTIPLE");
                    intent.setType("image/*");
                    intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
                    context.startActivity(intent);
//                    handler.obtainMessage().sendToTarget();
                }
            }
        }).start();
    }

    /***
     * 测量记录打印
     * @param context
     * @param idCard
     * @param archive
     * @return
     */
    private static List<Uri> createJKCL(Context context, String idCard, Archive archive) {
        List<Uri> imageUris = new ArrayList<>();
        boolean hasData = false;
        niaoye niaoyeBean = new niaoye();
        niaoyeBean.setIdCard(idCard);
        String niaoye_Time = "";
        List<niaoye> niaoyes = (List<niaoye>) DBService
                .queryByIdCard(niaoyeBean);
        String glu = "";
        String leu = "";
        String bld = "";
        String ph = "";
        String pro = "";
        String ubg = "";
        String nit = "";
        String sg = "";
        String ket = "";
        String bil = "";
        String vc = "";
        if (niaoyes != null && niaoyes.size() > 0) {
            niaoye bean = niaoyes.get(niaoyes.size() - 1);
            niaoye_Time = bean.getTime();// 测量时间
            glu = bean.getGlu();
            leu = bean.getLeu();
            bld = bean.getBld();
            ph = bean.getPh();
            pro = bean.getPro();
            ubg = bean.getUbg();
            nit = bean.getNit();
            sg = bean.getSg();
            ket = bean.getKet();
            bil = bean.getBil();
            vc = bean.getVc();
            hasData = true;
        }
        String name = archive.getPersonName();
        String sex = "";
        String sexCode = archive.getSexCode();
        if (sexCode.equals("1")) {
            sex = "男";
        } else if (sexCode.equals("2")) {
            sex = "女";
        }
        int age = Tools.getYearoldByIdcard(idCard);
        String yearsOld = age == 0 ? "" : age + "";
        // 血糖
        xuetang xuetangBean = new xuetang();
        xuetangBean.setIdCard(idCard);
        List<xuetang> xuetangs = (List<xuetang>) DBService
                .queryByIdCard(xuetangBean);
        String niaoyeDate = "";
        String glu_xuetangyi = "";
        String glu_time = "";
        String glu_eat = "";
        if (xuetangs != null && xuetangs.size() > 0) {
            hasData = true;
            // for (int i = 0; i < xuetangs.size(); i++) {
            xuetang bean = xuetangs.get(xuetangs.size() - 1);
            String xuetang_time = bean.getTime();
            // 如果是当天的时间，就循环到最新的一条。
            // if (xuetang_time.contains(niaoyeTime)) {
            glu_xuetangyi = bean.getGlu();
            glu_time = bean.getTime();
            xuetang_time = glu_time;
            glu_eat = bean.getBeforeafter();
            // }
            // }
        }
        // 血压
        xueya xueyaBean = new xueya();
        xueyaBean.setIdCard(idCard);
        List<xueya> xueyas = (List<xueya>) DBService.queryByIdCard(xueyaBean);
        String dbp = "";
        String sbp = "";
        String pulse = "";
        String xueyaTime = "";
        String xueyaHand = "";
        if (xueyas != null && xueyas.size() > 0) {
            hasData = true;
            // for (int i = 0; i < xueyas.size(); i++) {
            xueya bean = xueyas.get(xueyas.size() - 1);
            String t = bean.getTime();
            // if (t.contains(niaoyeTime)) {
            dbp = bean.getDbp();
            sbp = bean.getSbp();
            pulse = bean.getPulse();
            xueyaTime = bean.getTime();
            niaoye_Time = xueyaTime;
            xueyaHand = bean.getHand();
            // }
            // }
        }
        // 体温
        String temp = "";
        String temp_time = "";
        tiwen tiwenBean = new tiwen();
        tiwenBean.setIdCard(idCard);
        List<tiwen> tiwens = (List<tiwen>) DBService.queryByIdCard(tiwenBean);
        if (tiwens != null && tiwens.size() > 0) {
            hasData = true;
            tiwen bean = tiwens.get(tiwens.size() - 1);
            temp = bean.getTemp();
            temp_time = bean.getTime();
            niaoye_Time = temp_time;
        }
        if (niaoye_Time.length() >= 10) {
            niaoyeDate = niaoye_Time.substring(0, 10).replace("/", "-");
        }
        if (!hasData) {

        } else {
            // FileSaveUtil.saveNiaoye_Xueya_XuetangPdf(context,
            // FileSaveUtil.getSDCardPath() + "/" + name + "/",
            // niaoye_Time.replace("/", "-").replace(" ", "") + ".doc",
            // name, sex, yearsOld, niaoye_Time, glu, leu, bld, ph, pro,
            // ubg, nit, sg, ket, bil, vc, sbp, dbp, pulse, xueyaTime,
            // glu_xuetangyi, glu_time, temp, temp_time);
            String pngPath = FileSaveUtil.getPrintPath_CLJL() + "/" + name;
            String pngFileName = "hebing.png";
            String hospitalName = SharedpreferenceUtil.getHospitalName(context,
                    "");
            boolean saveOk = FileSaveUtil.saveNiaoye_Xueya_XuetangBitmap(
                    context, pngPath, pngFileName, idCard,
                    hospitalName, name, sex, yearsOld, niaoye_Time, glu, leu,
                    bld, ph, pro, ubg, nit, sg, ket, bil, vc, sbp, dbp, pulse,
                    xueyaTime, xueyaHand, glu_xuetangyi, glu_time, glu_eat,
                    temp, temp_time);
            if (saveOk) {
                File file = new File(pngPath, pngFileName);
                imageUris.add(Uri.fromFile(file));
            } else {
            }
        }
        return imageUris;
    }


    /***
     * 批量生产或打印心电报告
     * @param context
     * @param queryDatas 需要查询的key(time)集合。循环查询每个Archive
     * @param handler  通知是否完成。
     * @param needPrint  是否需要调用printershare打印？
     */
    public static void multiCreateECG(final Context context, final List<String> queryDatas, final Handler handler, final boolean needPrint
    ) {
        new BackGroundThread(new BackGroundThread.BackGroundTask() {
            @Override
            public void process() {
                ArrayList<Uri> imageUris = new ArrayList<>();
                //循环查询健康档案
                for (int i = 0; i < queryDatas.size(); i++) {
                    String queryTime = queryDatas.get(i);
                    if (!TextUtils.isEmpty(queryTime)) {
                        // 从数据库获取单个健康档案数据。
                        ArchiveBean queryBean = new ArchiveBean();
                        queryBean.setTime(queryTime);
                        ArchiveBean bean = null;
                        List<ArchiveBean> lists = (List<ArchiveBean>) JSONDBService
                                .queryByKey(queryBean);
                        if (lists != null && lists.size() > 0) {
                            bean = lists.get(0);
                            Archive archive = null;
                            archive = new Gson().fromJson(bean.getJson(), Archive.class);
                            if (archive != null) {
                                String idCard = archive.getIdCard();
                                String name = archive.getPersonName();
                                List<Uri> tempUris = createECG(context, idCard);
                                    if (tempUris != null && tempUris.size() > 0) {
                                        imageUris.addAll(tempUris);
                                    }
                            }
                        }
                    }
                }

                handler.obtainMessage(UserListActivity.WHAT_PRINTOK).sendToTarget();
                if (needPrint) {
                    Intent intent = new Intent();
                    intent.setAction("android.intent.action.SEND_MULTIPLE");
                    intent.setType("image/*");
                    intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
                    context.startActivity(intent);
//                    handler.obtainMessage().sendToTarget();
                }
            }
        }).start();
    }

    private static List<Uri> createECG(Context context, String idCard) {
        xindian queryBean = new xindian();
        queryBean.setIdCard(idCard);
        List<Uri> imageUris = new ArrayList<Uri>();
        List<xindian> xindians = (List<xindian>) DBService.queryByIdCard(queryBean);
        if (xindians != null && xindians.size() > 0) {
            xindian bean = xindians.get(xindians.size() - 1);
            String picPath = bean.getPicPath();
            File file = new File(picPath);
            imageUris.add(Uri.fromFile(file));
        }
        return imageUris;
    }

    /***
     * 批量生产或打印心电报告 带有
     * @param context
     * @param queryDatas 需要查询的key(time)集合。循环查询每个Archive
     * @param handler  通知是否完成。
     * @param needPrint  是否需要调用printershare打印？
     */
    public static void multiCreateECG_Result(final Context context, final List<String> queryDatas, final Handler handler, final boolean needPrint
    ) {
        new BackGroundThread(new BackGroundThread.BackGroundTask() {
            @Override
            public void process() {
                ArrayList<Uri> imageUris = new ArrayList<>();
                //循环查询健康档案
                for (int i = 0; i < queryDatas.size(); i++) {
                    String queryTime = queryDatas.get(i);
                    if (!TextUtils.isEmpty(queryTime)) {
                        // 从数据库获取单个健康档案数据。
                        ArchiveBean queryBean = new ArchiveBean();
                        queryBean.setTime(queryTime);
                        ArchiveBean bean = null;
                        List<ArchiveBean> lists = (List<ArchiveBean>) JSONDBService
                                .queryByKey(queryBean);
                        if (lists != null && lists.size() > 0) {
                            bean = lists.get(0);
                            Archive archive = null;
                            archive = new Gson().fromJson(bean.getJson(), Archive.class);
                            if (archive != null) {
                                String idCard = archive.getIdCard();
                                String name = archive.getPersonName();
                                List<Uri> tempUris = createECG_Result(context, idCard);
                                    if (tempUris != null && tempUris.size() > 0) {
                                        imageUris.addAll(tempUris);
                                    }
                            }
                        }
                    }
                }

                handler.obtainMessage(UserListActivity.WHAT_PRINTOK).sendToTarget();
                if (needPrint) {
                    Intent intent = new Intent();
                    intent.setAction("android.intent.action.SEND_MULTIPLE");
                    intent.setType("image/*");
                    intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
                    context.startActivity(intent);
//                    handler.obtainMessage().sendToTarget();
                }
            }
        }).start();
    }

    private static List<Uri> createECG_Result(Context context, String idCard) {
        xindian queryBean = new xindian();
        queryBean.setIdCard(idCard);
        List<Uri> imageUris = new ArrayList<Uri>();
        List<xindian> xindians = (List<xindian>) DBService.queryByIdCard(queryBean);
        if (xindians != null && xindians.size() > 0) {
            xindian bean = xindians.get(xindians.size() - 1);
            String picPath = bean.getPicPath();
            String result = bean.getRhythm();
            String resultPicPath = FileSaveUtilecg2.saveECGResultPNG(picPath, result);
            File file = new File(resultPicPath);
            imageUris.add(Uri.fromFile(file));
        }
        return imageUris;
    }

    /***
     * 批量生产或老年人生活自理能力
     * @param context
     * @param queryDatas 需要查询的key(time)集合。循环查询每个Archive
     * @param handler  通知是否完成。
     * @param needPrint  是否需要调用printershare打印？
     */
    public static void multiCreateSHZL(final Context context, final List<String> queryDatas, final Handler handler, final boolean needPrint
    ) {
        new BackGroundThread(new BackGroundThread.BackGroundTask() {
            @Override
            public void process() {
                ArrayList<Uri> imageUris = new ArrayList<>();
                //循环查询健康档案
                for (int i = 0; i < queryDatas.size(); i++) {
                    String queryTime = queryDatas.get(i);
                    if (!TextUtils.isEmpty(queryTime)) {
                        // 从数据库获取单个健康档案数据。
                        ArchiveBean queryBean = new ArchiveBean();
                        queryBean.setTime(queryTime);
                        ArchiveBean bean = null;
                        List<ArchiveBean> lists = (List<ArchiveBean>) JSONDBService
                                .queryByKey(queryBean);
                        if (lists != null && lists.size() > 0) {
                            bean = lists.get(0);
                            Archive archive = null;
                            archive = new Gson().fromJson(bean.getJson(), Archive.class);
                            if (archive != null) {
                                String idCard = archive.getIdCard();
                                String name = archive.getPersonName();
                                List<Uri> tempUris = createSHZL(context, idCard, archive.getPersonName());
                                    if (tempUris != null && tempUris.size() > 0) {
                                        imageUris.addAll(tempUris);
                                    }
                            }
                        }
                    }
                }

                handler.obtainMessage(UserListActivity.WHAT_PRINTOK).sendToTarget();
                if (needPrint) {
                    Intent intent = new Intent();
                    intent.setAction("android.intent.action.SEND_MULTIPLE");
                    intent.setType("image/*");
                    intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
                    context.startActivity(intent);
//                    handler.obtainMessage().sendToTarget();
                }
            }
        }).start();
    }

    /**
     * 生活自理能力
     *
     * @param context
     * @param idCard
     * @param name
     * @return
     */
    private static List<Uri> createSHZL(Context context, String idCard, String name) {
//        JktjBitmapUtil.createLNRSHZLNL_Bitmap(context, oa);
        OldPeopleSelfCare queryBean = new OldPeopleSelfCare();
        queryBean.setIdCard(idCard);
        List<Uri> imageUris = new ArrayList<Uri>();
        List<OldPeopleSelfCare> oldPeopleSelfCares = (List<OldPeopleSelfCare>) DBService.queryByIdCard(queryBean);
        if (oldPeopleSelfCares != null && oldPeopleSelfCares.size() > 0) {
            OldPeopleSelfCare oldPeopleSelfCare = oldPeopleSelfCares.get(oldPeopleSelfCares.size() - 1);
            OldAssessment oa = new OldAssessment();
            oa.setFood(oldPeopleSelfCare.getJC());
            oa.setFoodLevel(oldPeopleSelfCare.getJCPF());
            oa.setWash(oldPeopleSelfCare.getSX());
            oa.setWashLevel(oldPeopleSelfCare.getSXPF());
            oa.setClothes(oldPeopleSelfCare.getCY());
            oa.setClothesLevel(oldPeopleSelfCare.getCYPF());
            oa.setToilet(oldPeopleSelfCare.getRC());
            oa.setToiletLevel(oldPeopleSelfCare.getRCPF());
            oa.setActivities(oldPeopleSelfCare.getHD());
            oa.setActivitiesLevel(oldPeopleSelfCare.getHDPF());
            oa.setSelfCareAbilityLevel(oldPeopleSelfCare.getZPFS());
//            oa.setEmpiId(time);
//            oa.setInputUnit(MyApplication.getOngovId());
//            oa.setInputUser(MyApplication.getOnDoctorId());
//            oa.setLastModifyUser(MyApplication.getOnDoctorId());
//            oa.setLastModifyUnit(MyApplication.getOngovId());
            oa.setLastModifyDate(oldPeopleSelfCare.getInputDate());
            oa.setInputDate(oldPeopleSelfCare.getInputDate());
            oa.setIdCard(idCard);
            System.gc();
            // 体检表1的画布，用来画好字。然后保存。
            Bitmap zlnlBitmap = JktjBitmapUtil.getBitmapByResId(context, R.raw.zilinengli);
            Bitmap zlnl = Bitmap.createBitmap(zlnlBitmap.getWidth(),
                    zlnlBitmap.getHeight(), Bitmap.Config.ARGB_8888);
            Canvas canvas = new Canvas(zlnl);
            canvas.drawBitmap(zlnlBitmap, 0, 0, null);
            zlnlBitmap.recycle();
            textPaint.setTextSize(textSize);
            canvas.drawText(name, 332, 280, textPaint);
            canvas.drawText(oa.getFoodLevel(), 1313, 587, textPaint);
            canvas.drawText(oa.getWashLevel(), 1313, 878, textPaint);
            canvas.drawText(oa.getClothesLevel(), 1313, 1177, textPaint);
            canvas.drawText(oa.getToiletLevel(), 1313, 1460, textPaint);
            canvas.drawText(oa.getActivitiesLevel(), 1313, 1768, textPaint);
            canvas.drawText(oa.getSelfCareAbilityLevel(), 1313, 1965, textPaint);
            System.out.println("name是=" + name);
            System.gc();
            String basePath = FileSaveUtil.getPrintPath_SHZL() + "/" + name;
            FileSaveUtil.saveBitmap(zlnl, basePath,
                    "lnrzlnl.png");
            zlnl.recycle();
            File file = new File(basePath, "lnrzlnl.png");
            imageUris.add(Uri.fromFile(file));
        }
        return imageUris;
    }

    /***
     * 批量生产或老年人中医体质辨识
     * @param context
     * @param queryDatas 需要查询的key(time)集合。循环查询每个Archive
     * @param handler  通知是否完成。
     * @param needPrint  是否需要调用printershare打印？
     */
    public static void multiCreateZYTZBS(final Context context, final List<String> queryDatas, final Handler handler, final boolean needPrint
    ) {
        new BackGroundThread(new BackGroundThread.BackGroundTask() {
            @Override
            public void process() {
                ArrayList<Uri> imageUris = new ArrayList<>();
                //循环查询健康档案
                for (int i = 0; i < queryDatas.size(); i++) {
                    String queryTime = queryDatas.get(i);
                    if (!TextUtils.isEmpty(queryTime)) {
                        // 从数据库获取单个健康档案数据。
                        ArchiveBean queryBean = new ArchiveBean();
                        queryBean.setTime(queryTime);
                        ArchiveBean bean = null;
                        List<ArchiveBean> lists = (List<ArchiveBean>) JSONDBService
                                .queryByKey(queryBean);
                        if (lists != null && lists.size() > 0) {
                            bean = lists.get(0);
                            Archive archive = null;
                            archive = new Gson().fromJson(bean.getJson(), Archive.class);
                            if (archive != null) {
                                String idCard = archive.getIdCard();
                                String name = archive.getPersonName();
                                List<Uri> tempUris = createZYTZBS(context, idCard, archive.getPersonName());
                                    if (tempUris != null && tempUris.size() > 0) {
                                        imageUris.addAll(tempUris);
                                    }
                            }
                        }
                    }
                }
                handler.obtainMessage(UserListActivity.WHAT_PRINTOK).sendToTarget();
                if (needPrint) {
                    Intent intent = new Intent();
                    intent.setAction("android.intent.action.SEND_MULTIPLE");
                    intent.setType("image/*");
                    intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
                    context.startActivity(intent);
//                    handler.obtainMessage().sendToTarget();
                }
            }
        }).start();
    }

    /**
     * 生活自理能力
     *
     * @param context
     * @param idCard
     * @param name
     * @return
     */
    private static List<Uri> createZYTZBS(Context context, String idCard, String name) {
//        JktjBitmapUtil.createLNRSHZLNL_Bitmap(context, oa);
        ChineseMedicineManage queryBean = new ChineseMedicineManage();
        queryBean.setIdCard(idCard);
        List<Uri> imageUris = new ArrayList<Uri>();
        List<ChineseMedicineManage> chineseMedicineManages = (List<ChineseMedicineManage>) DBService.queryByIdCard(queryBean);
        if (chineseMedicineManages != null && chineseMedicineManages.size() > 0) {
            ChineseMedicineManage manage = chineseMedicineManages.get(chineseMedicineManages.size() - 1);
            int textSize = 34;
            Paint textPaint = new Paint();
            // textPaint.setStrokeWidth(3);
            textPaint.setDither(true);
            textPaint.setStyle(Paint.Style.FILL);
            textPaint.setTextSize(textSize);
            textPaint.setColor(Color.BLACK);
            System.gc();
            // 体检表1的画布，用来画好字。然后保存。
            Bitmap zhongyiyaoBitmap = ZYYBitmapUtil.getBitmapByResId(context,
                    R.raw.zhongyiyao1);
            Bitmap zhongyiyao = Bitmap.createBitmap(
                    zhongyiyaoBitmap.getWidth(),
                    zhongyiyaoBitmap.getHeight(), Bitmap.Config.ARGB_8888);
            Canvas canvas = new Canvas(zhongyiyao);
            canvas.drawBitmap(zhongyiyaoBitmap, 0, 0, null);
            zhongyiyaoBitmap.recycle();
            Bitmap zhongyiyaoBitmap2 = ZYYBitmapUtil.getBitmapByResId(context,
                    R.raw.zhongyiyao2);
            Bitmap zhongyiyao2 = Bitmap.createBitmap(
                    zhongyiyaoBitmap2.getWidth(),
                    zhongyiyaoBitmap2.getHeight(), Bitmap.Config.ARGB_8888);
            Canvas canvas2 = new Canvas(zhongyiyao2);
            canvas2.drawBitmap(zhongyiyaoBitmap2, 0, 0, null);
            zhongyiyaoBitmap2.recycle();
            textPaint.setTextSize(textSize);
            canvas.drawText(name, 435, 129, textPaint);// 姓名
            String gou = "√";
            textPaint.setTextSize(60);
            // String title = SharedPreferenceUtil
            // .getHospitalName(context, "");
            int titleSize = 60;
            // textPaint.setTextSize(titleSize);
            // 画中医标题。
            // canvas.drawText(title, canvas.getWidth() / 2
            // - (titleSize * title.length() / 2), 60 * 2, textPaint);
            // canvas.drawText(userInfo.getSex(), 480, 354, textPaint);// 性别
            // canvas.drawText(userInfo.getYearold(), 754, 354,
            // textPaint);// 年龄
            // canvas.drawText(userInfo.getName(), 223, 372,
            // textPaint);//编号，暂时没有
            int defenX = 1337;
            textPaint.setTextSize(50);
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getEnergyFull()), 318,
                    textPaint);// 问题1
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getEasyWeary()), 371,
                    textPaint);// 问题2
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getEasyPant()), 434,
                    textPaint);// 问题3
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getVoiceWeak()), 499,
                    textPaint);// 问题4
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getMoodiness()), 559,
                    textPaint);// 问题5
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getNervous()), 616,
                    textPaint);// 问题6
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getLoneliness()), 681,
                    textPaint);// 问题7
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getEasyScare()), 743,
                    textPaint);// 问题8
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getOverweight()), 792,
                    textPaint);// 问题9
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getEyeDry()), 878,
                    textPaint);// 问题10
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getFootFearCold()), 933,
                    textPaint);// 问题11
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getBackFearCold()), 997,
                    textPaint);// 问题12
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getFearCold()), 1064,
                    textPaint);// 问题13
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getCold()), 1120,
                    textPaint);// 问题14
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getRhinobyon()), 1202,
                    textPaint);// 问题15
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getMouthGreasy()), 1262,
                    textPaint);// 问题16
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getAllergy()), 1329,
                    textPaint);// 问题17
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getSkinUrticaria()),
                    1429, textPaint);// 问题18
            canvas.drawText(gou, ZYYBitmapUtil.getzyy1_x(manage.getSkinBleeding()), 1492,
                    textPaint);// 问题19
            defenX = 1414;
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getSkinRed()), 90,
                    textPaint);// 问题20
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getSkinDry()), 151,
                    textPaint);// 问题21
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getLimbsNumb()), 214,
                    textPaint);// 问题22
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getFaceGreasy()), 273,
                    textPaint);// 问题23
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getFaceDim()), 334,
                    textPaint);// 问题24
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getSkinEczema()), 396,
                    textPaint);// 问题25
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getMouthDry()), 457,
                    textPaint);// 问题26
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getBitterTaste()), 519,
                    textPaint);// 问题27
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getBellyLarge()), 519,
                    textPaint);// 问题28
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getFearCool()), 585,
                    textPaint);// 问题29
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getStoolStiction()),
                    742, textPaint);// 问题30
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getStoolDry()), 826,
                    textPaint);// 问题31
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getFurStodgily()), 888,
                    textPaint);// 问题32
            canvas2.drawText(gou, ZYYBitmapUtil.getzyy2_x(manage.getStasisPurple()),
                    1007, textPaint);// 问题33
            int defenY = 1140;
            textPaint.setTextSize(textSize);
            canvas2.drawText(manage.getScore1(), 366, defenY, textPaint);// 体质1
            canvas2.drawText(manage.getScore2(), 573, defenY, textPaint);// 体质2
            canvas2.drawText(manage.getScore3(), 773, defenY, textPaint);// 体质1
            canvas2.drawText(manage.getScore4(), 980, defenY, textPaint);// 体质1
            canvas2.drawText(manage.getScore5(), 1160, defenY, textPaint);// 体质1
            canvas2.drawText(manage.getScore6(), 1347, defenY, textPaint);// 体质1
            canvas2.drawText(manage.getScore7(), 1591, defenY, textPaint);// 体质1
            canvas2.drawText(manage.getScore8(), 1819, defenY, textPaint);// 体质1
            canvas2.drawText(manage.getScore9(), 2046, defenY, textPaint);// 体质1
            ZYYBitmapUtil.drawTizhiLeixing(canvas2, manage, textPaint);
            String date = manage.getReportDate();
            // FORMAT = "yyyy-MM-dd HH:mm:ss";
            if (!TextUtils.isEmpty(date) && date.length() >= 10) {
                String year = date.substring(0, 4);
                String month = date.substring(5, 7);
                String day = date.substring(8, 10);
                int dateY = 1502;
                canvas2.drawText(year, 563, dateY, textPaint);// 年
                canvas2.drawText(month, 702, dateY, textPaint);// 月
                canvas2.drawText(day, 787, dateY, textPaint);// 日
            }
            String basePath = FileSaveUtil.getPrintPath_ZYTZBS() + File.separator + name;
            FileSaveUtil.saveBitmap(zhongyiyao, basePath, "zhongyiyao1.png");
            FileSaveUtil.saveBitmap(zhongyiyao2, basePath, "zhongyiyao2.png");
            zhongyiyao.recycle();
            zhongyiyao2.recycle();
            File file = new File(basePath,
                    "zhongyiyao1.png");
            File file2 = new File(basePath,
                    "zhongyiyao2.png");
            imageUris.add(Uri.fromFile(file));
            imageUris.add(Uri.fromFile(file2));
        }
        return imageUris;
    }


}
